Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Refining the data selection with a WHERE clause
So far you’ve been selecting all the Customer records in the database. Now you’ll refine that selection to show only those Customers from the state of New Hampshire. There is a State field in the Customer table that holds the two-letter state abbreviation for states in the USA.
The Progress 4GL supports a
WHEREclause in any statement that retrieves data from the database, which will be familiar to you if you have used SQL or other similar data access languages. TheWHEREkeyword can be followed by any expression that identifies a subset of the data. You’ll learn a lot more about this in later chapters, but for now a simple expression is all you need.
![]()
To refine the data selection in your test procedure:
- Add the following
WHEREclause to the end of yourFOR EACHstatement:
- Press F2 to see the reduced list of Customers. The list should now use only a bit more than a page in the display window.
- Add a sort expression to the end of your
WHEREclause to sort the Customers in order by their City. The 4GL uses the keywordBYto indicate a sort sequence:
- Press F2 to run the procedure again to see the effects of your change.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |